use std::sync::Arc;

use axum::{
    extract::{Request, State},
    middleware::Next,
    response::Response,
};

use crate::state::AppState;

pub async fn middleware(
    State(state): State<Arc<AppState>>,
    requeust: Request,
    next: Next,
) -> Response {
    println!("state map: {:?}", state.map);
    let resp = next.run(requeust).await;
    resp
}
